package com.itheima.mString;

import java.util.Random;

/*
    防止恶意注册
 */
public class Work09 {
    public static void main(String[] args) {
        Random r = new Random();
        int index;
        int index4;
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 4; i++) {
            index4 = r.nextInt(3) + 1;
            switch (index4) {
                case 1:
                    index = r.nextInt(10);
                    sb.append(index);
                    break;
                case 2:
                    index = r.nextInt(26) + 65;
                    char b = (char) index;
                    sb.append(b);
                    break;
                case 3:
                    index = r.nextInt(26) + 97;
                    char a = (char) index;
                    sb.append(a);
                    break;
            }
        }
        String s = sb.toString();
        System.out.println(s);
    }
}
